#pragma once
#include "FileDeviceHandleFwd.h"

namespace ja2{ namespace vfs
{
	//! Descriptor for file instances.
	class FileDescriptor : boost::noncopyable
	{
		// Attributes
	private:
		//! File name.
		boost::filesystem::path const m_Name;

		// Operations
	public:
		//! Get file name.
		boost::filesystem::path const &get_file_name() const;
		//! Get the file handle.
		FileDeviceHandlePtr_t get_file_handle(std::ios_base::openmode Mode) const;
	private:
		//! Implementation.
		virtual FileDeviceHandlePtr_t do_get_file_handle(std::ios_base::openmode Mode) const = 0;

		// Construction/Destruction
	protected:
		FileDescriptor(boost::filesystem::path const &FileName);
	public:
		virtual ~FileDescriptor() = 0 {}
	};
} /*vfs*/} /*ja2*/
